<template>
  <view class="simple-demo">
    <!-- 页面内容 -->
    <view class="content">
      <view class="header">
        <text class="title">简单示例</text>
        <text class="subtitle">快速集成底部导航</text>
      </view>
      
      <view class="card">
        <text class="card-title">当前页面: {{ currentPage }}</text>
        <text class="card-desc">点击底部导航切换页面</text>
      </view>
      
      <view class="features">
        <view class="feature-item">
          <text class="feature-icon">📱</text>
          <text class="feature-text">响应式设计</text>
        </view>
        <view class="feature-item">
          <text class="feature-icon">🎨</text>
          <text class="feature-text">主题切换</text>
        </view>
        <view class="feature-item">
          <text class="feature-icon">✨</text>
          <text class="feature-text">动画效果</text>
        </view>
      </view>
    </view>
    
    <!-- 底部导航 -->
    <bottom-nav-h5
      :items="navItems"
      :current="currentIndex"
      theme="blue"
      @change="handleNavChange"
    />
  </view>
</template>

<script>
import BottomNavH5 from '@/components/bottom-nav-h5/bottom-nav-h5.vue'

export default {
  name: 'BottomNavSimple',
  components: {
    BottomNavH5
  },
  data() {
    return {
      currentIndex: 0,
      navItems: [
        {
          text: '首页',
          iconText: '🏠',
          pagePath: '/pages/index/index'
        },
        {
          text: '评估',
          iconText: '🤖',
          pagePath: '/pages/smart-evaluation/index'
        },
        {
          text: '工具',
          iconText: '🛠️',
          pagePath: '/pages/tools/index',
          badge: '3'
        },
        {
          text: '进度',
          iconText: '📊',
          pagePath: '/pages/progress-tracking/index',
          dot: true
        },
        {
          text: '我的',
          iconText: '👤',
          pagePath: '/pages/personal-center/index'
        }
      ]
    }
  },
  computed: {
    currentPage() {
      return this.navItems[this.currentIndex]?.text || '首页'
    }
  },
  methods: {
    handleNavChange(event) {
      this.currentIndex = event.index
    }
  }
}
</script>

<style lang="scss" scoped>
.simple-demo {
  min-height: 100vh;
  background: #f5f7fa;
  padding-bottom: 80px;
}

.content {
  padding: 20px;
}

.header {
  text-align: center;
  margin-bottom: 30px;
  padding: 30px 20px;
  background: linear-gradient(135deg, #0A2463, #1E3A8A);
  border-radius: 16px;
  color: white;
}

.title {
  display: block;
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
}

.subtitle {
  display: block;
  font-size: 14px;
  opacity: 0.9;
}

.card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.card-title {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 8px;
}

.card-desc {
  display: block;
  font-size: 14px;
  color: #6b7280;
}

.features {
  display: flex;
  justify-content: space-around;
  gap: 16px;
}

.feature-item {
  flex: 1;
  text-align: center;
  padding: 16px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.feature-icon {
  display: block;
  font-size: 24px;
  margin-bottom: 8px;
}

.feature-text {
  display: block;
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
}
</style>
